//
//  CC_NavigationCollec_CollectionViewCell.m
//  HimalayaMountain
//
//  Created by dllo on 16/7/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CC_NavigationCollec_CollectionViewCell.h"
#import "CCBaseMainTitleLabel.h"
#import "CCBaseView.h"
#import "CC_Find_NaviModel.h"

@interface CC_NavigationCollec_CollectionViewCell ()

@property(nonatomic, retain) CCBaseMainTitleLabel *topicLabel;
@property(nonatomic, retain) CCBaseView *lineView;

@end


@implementation CC_NavigationCollec_CollectionViewCell

- (void)dealloc
{
    [_naviModel release];
    [_topicLabel release];
    [_lineView release];
    [super dealloc];
}


-(instancetype)initWithFrame:(CGRect)frame{
    
    
    if (self = [super initWithFrame:frame]) {
        self.topicLabel = [[CCBaseMainTitleLabel alloc]init];
        self.topicLabel.textAlignment = 1;
        [self.contentView addSubview:_topicLabel];
        [_topicLabel release];
        
        self.lineView = [[CCBaseView alloc]init];
        self.lineView.backgroundColor = AUTOCOLOR;
        [self.contentView addSubview:_lineView];
        [_lineView release];
    }
    
    return self;
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.topicLabel.frame = CGRectMake(0, 0, SFWIDTH, SFHEIGHT - 2);
    self.lineView.frame = CGRectMake(0, _topicLabel.frame.size.height, SFWIDTH, 2);

}

-(void)setNaviModel:(CC_Find_NaviModel *)naviModel{
    if (_naviModel != naviModel) {
        [_naviModel release];
        _naviModel = [naviModel retain];
    }
    
    self.topicLabel.text = naviModel.title;
}

-(void)setIsSelected:(BOOL)isSelected{
    
    _isSelected = isSelected;
    if (isSelected) {
        self.topicLabel.textColor = [UIColor orangeColor];
        self.lineView.backgroundColor = [UIColor orangeColor];
    }else{
        self.topicLabel.textColor = [UIColor blackColor];
        self.lineView.backgroundColor = [UIColor clearColor];
    }
    
    
    
}




@end
